package cn.dgut.training.controller;

import cn.dgut.training.entity.goods.Cart;
import cn.dgut.training.entity.goods.Goods;
import cn.dgut.training.entity.goods.GoodsProduct;
import cn.dgut.training.vo.CommonResponse;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@FeignClient(value = "shop-goods")
public interface GoodsService {

    //购物车

    @PostMapping("/cart/delBySys")
    CommonResponse delBySys(@RequestParam("userId") Long userId);

    @PostMapping("/cart/listChecked")
    List<Cart> listChecked(@RequestParam("userId") Long userId);

    @PostMapping("/cart/findById")
    Cart findById(@RequestParam("cartId") Long cartId);

    @PostMapping("/cart/deleteChecked")
    public void deleteChecked(@RequestParam("userId") Long userId);



    //分类


    @PostMapping("/category/list")
    CommonResponse listFirstCategory();

    @GetMapping("/category/getCategoryList")
    List<Map> getCategoryList();


    //商品


    @GetMapping("/goods/queryByNew")
    List<Goods> queryByNew();


    @GetMapping("/goods/queryByHot")
    List<Goods> queryByHot();


    @PostMapping("/goods/getOneGoods")
    Goods getOneGoods(@RequestParam("goodsId") Long goodsId);

    @GetMapping("/goods/updateStock")
    void updateStock(@RequestParam("productId") Long productId,@RequestParam("number") Integer number);

    @GetMapping("/goods/findmessage")
    public CommonResponse findGoodsByName(@RequestParam("goodsName") String goodsName);

    @GetMapping("/goods-product/findmessage")
    public CommonResponse findGoodsProductById(@RequestParam("id") long id);
}
